//
//  XCBaseViewController.m
//  TTLestening
//
//  Created by dllo on 16/3/21.
//  Copyright © 2016年 dilo. All rights reserved.
//

#import "XCBaseViewController.h"

#define WIDTH [UIScreen mainScreen].bounds.size.width

#define HEIGHT [UIScreen mainScreen].bounds.size.height

@interface XCBaseViewController ()

//@property (nonatomic,retain)UIView *backview;

@property (nonatomic,retain)UIView *buttonimageview;

@property (nonatomic,retain)UIButton *butttonImage;

@property (nonatomic,retain)UILabel *songname;

@property (nonatomic,retain)UILabel *songer;

@property (nonatomic,retain)UIButton *play;

@property (nonatomic,retain)UIButton *songlist;

@property (nonatomic,retain)UIView *buttonview;

@end

@implementation XCBaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    // self.view.backgroundColor = [UIColor yellowColor];
    
   
    
    [self creatview];
}

-(void)creatview{
    self.backview = [[UIView alloc]initWithFrame:CGRectMake(10, HEIGHT - 49, WIDTH - 20, 49)];
    [self.view addSubview:self.backview];
    self.backview.backgroundColor = [UIColor brownColor];
    
    self.buttonimageview = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 50, 49)
                            ];
    
    [self.backview addSubview:self.buttonimageview];
    self.buttonimageview.backgroundColor = [UIColor yellowColor];
    
    
    self.butttonImage = [UIButton buttonWithType:UIButtonTypeCustom];
    self.butttonImage.frame = CGRectMake(0, 0, 40,40);
    [self.buttonimageview addSubview:self.butttonImage];
    [self.butttonImage setBackgroundImage:[UIImage imageNamed:@"iconfont-renwu"] forState:UIControlStateNormal];
    self.butttonImage.center = self.buttonimageview.center;
    self.butttonImage.layer.cornerRadius = 20;
    self.butttonImage.layer.masksToBounds = YES;
    [self.butttonImage addTarget:self action:@selector(appearanceMusicview:) forControlEvents:UIControlEventTouchUpInside];
    
    
    
    self.songname = [[UILabel alloc]initWithFrame:CGRectMake(60, 5, WIDTH - 170, 20)];
    [self.backview addSubview:self.songname];
    self.songname.text = @"当我的喊朋友";
    
    
    self.songer = [[UILabel alloc]initWithFrame:CGRectMake(60, 30, WIDTH - 170, 12)];
    [self.backview addSubview:self.songer];
    self.songer.text = @"汪峰";
    
    self.buttonview = [[UIView alloc]initWithFrame:CGRectMake(WIDTH - 120, 0, 100, 49)];
    [self.backview addSubview:self.buttonview];
    self.buttonview.backgroundColor = [UIColor yellowColor];
    
    
    self.play = [UIButton buttonWithType:UIButtonTypeCustom];
    self.play.frame = CGRectMake(0, 0, 25, 25);
    [self.buttonview addSubview:self.play];
    [self.play setBackgroundImage:[UIImage imageNamed:@"iconfont-bofang-4"] forState:UIControlStateNormal];
    self.play.center = CGPointMake(30, 25);
    [self.play addTarget:self action:@selector(play:) forControlEvents:UIControlEventTouchUpInside];
    
    
    self.songlist = [UIButton buttonWithType:UIButtonTypeCustom];
    self.songlist.frame = CGRectMake(0, 0, 30, 30);
    [self.buttonview addSubview:self.songlist];
    [self.songlist setBackgroundImage:[UIImage imageNamed:@"iconfont-iconfontttpodicon3-4"] forState:UIControlStateNormal];
    self.songlist.center = CGPointMake(75, 25);
    
    [self.songlist addTarget:self action:@selector(songlist:) forControlEvents:UIControlEventTouchUpInside];
    
    
     [self.view bringSubviewToFront:self.backview];
}



-(void)appearanceMusicview:(UIButton *)buuton{
    
    NSLog(@"出现音乐页面");
    
}
-(void)play:(UIButton *)buuton{
    
    NSLog(@"播放");
    
}

-(void)songlist:(UIButton *)button{
    
    
    NSLog(@"出现歌单页面");
}

//-(void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
//    
//  NSLog(@"")
//    
//}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
